﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SmsVotes.DataAccess
{
    public class DataContext : IDisposable
    {
        private SMSServiceEntities _context;

        private static readonly DataContext _instance = new DataContext();

        private DataContext()
        {
            _context = new SMSServiceEntities();
        }

        public static DataContext Instance
        {
            get
            {
                return _instance;
            }
        }

        public SMSServiceEntities Context
        {
            get
            {
                return _context;
            }
        }


        #region IDisposable Members

        public void Dispose()
        {
            if (_context != null)
                _context.Dispose();
        }

        #endregion
    }
}
